#include "electric_motor.hpp"
#include <cmath>
#include <vector>
#include <iostream>

fp_type ElectricMotorProperty::getMaxPerimeterSpeed(fp_type wheelDiameter) const {
    fp_type wheelPerimeter = M_PI * wheelDiameter;
    fp_type wheelMaxRPM = maxRPM / gearRatio;
    return wheelMaxRPM / 60 * wheelPerimeter * 3.6;
}

fp_type ElectricMotorProperty::getTorqueLimitOnAxle(fp_type wheelDiameter) const {
    return 2 * maxTorque * gearRatio / wheelDiameter / 1000.0;
}

std::vector<ElectricMotor> ElectricMotor_createMulti(int motorNum) {
    std::vector<ElectricMotor> motors;
    for (int i = 0; i < motorNum; ++i) {
        motors.emplace_back(static_cast<char>(i), true);
    }
    std::cout << "Created multiple motors." << std::endl;
    return motors;
}

